#ifndef __SMALLOC__
#define __SMALLOC__ 1
#include <malloc.h>
extern unsigned char* data;

class SM {
 public:
  static SM& Obj() {
    static SM single;
    return single;
  }
  static void* malloc(size_t size);
  static bool free(void*);
};
namespace Fit {
void* best_fit(size_t size);
void* worst_fit(size_t size);
void* first_fit(size_t size);
/**
 * @brief memory shrinks
 */
void shrink();
}  // namespace Fit

/**
 * @brief Allocation Methods
 */
enum class Alloc { First, Best, Worst };
/**
 * @brief the block for recording allocated block
 */
struct pointer {
  static constexpr unsigned char offset = sizeof(char*);
  unsigned char* physical;
  size_t size;
};
#endif  //__SMALLOC__